package com.szholly.utils.session;

import com.szholly.utils.session.id.ISessionIdGenerator;
import com.szholly.utils.session.provider.ISessionProvider;
import com.szholly.utils.session.provider.cache.ISessionCache;
import com.szholly.utils.spring.SpringBeanFactory;

/**
 * Session提供工厂
 */
public class SessionFactory {

	/**
	 * 获取Session对象
	 * @return
	 */
	public static ISessionProvider getSession(){
		ISessionProvider httpSession = (ISessionProvider)SpringBeanFactory.getBean("sessionProvider");
		return httpSession;
	}
	
	/**
	 * 获取配置的Session缓存对象
	 * @return
	 */
	public static ISessionCache getSessionCache(){
		ISessionCache httpSession = (ISessionCache)SpringBeanFactory.getBean("sessionCache");
		return httpSession;
	}
	
	/**
	 * 获取配置的Session缓存对象
	 * @return
	 */
	public static ISessionIdGenerator getSessionIdGenerator(){
		ISessionIdGenerator httpSession = (ISessionIdGenerator)SpringBeanFactory.getBean("sessionCache");
		return httpSession;
	}
}